Repository navigation
Conversation
The signal handler records a frame-pointer walk of the crashed thread because libunwindstack allocates, and `has_captured_stack()` preferred that walk over unwinding the saved fault context with libunwindstack. The walk skips the caller of a leaf function without a frame record and stops at frames without records such as ART's. In a React Native app, a JNI crash kept only the JNI function and a junk address. Unwind the saved context first and fall back to the walk if that fails.
Drop the libunwindstack unwind from the previous commit. It replaced the stacktrace that `on_crash` had already seen and possibly edited with a new one. Fix the signal handler's capture instead. The capture walks frame records from `x29` on arm64. A leaf function without a frame record leaves its caller only in `x30`, so the walk skipped it. Record `x30` as the first caller.
The frame-pointer capture stops at frames without records, such as ART's in a JNI crash. Replace it with the libunwindstack unwind unless `on_crash` or `before_send` edited it. `on_crash` still sees the capture.
jpnurmi
force-pushed
the
jpnurmi/fix/native-android-stacktrace
branch
from
November 30, 2026 14:57
c90edf8 to
9559965
Compare
The crashed app waits for the daemon. Instead of rebuilding and serializing the captured stacktrace, compare the event's frame addresses with the capture. This still detects a stacktrace replaced by `on_crash` or `before_send`, but no longer in-place edits.
Combining `has_captured_stack()` with a negated, similarly named predicate read poorly.
Draft
5 of 11 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Required for:
A JNI crash captured by the Native backend in a React Native app showed only the JNI function and an unknown address. The crash daemon preferred the signal handler's frame-pointer capture (#2174) over unwinding with libunwindstack (#1725). The capture skips the caller of a leaf function without a frame record and stops at frames without records, such as ART's.
x30as the first caller.on_crashorbefore_sendedited it.on_crashstill sees the capture.